﻿using STT.Layer.Connection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace STT.Profile.UserControlsHV
{
    public partial class UcMenuHV : System.Web.UI.UserControl
    {
        ToolBox tb = new ToolBox();
        Control ct = new Control();
        protected void Page_Load(object sender, EventArgs e)
        {
            //Session["Chucvu"] = "Giám đốc";
            LoadAvatar();
            if (Session["Chucvu"].ToString() == "Giám đốc")
            {
                qlcd.Visible = true;
            }
            else
                qlcd.Visible = false;
        }
        private void LoadAvatar()
        {
            if (Session["Mahv"] != null)
            {
                DtlAvatar.DataSource = tb.GetDataTableById2("[Get_HocVien_ByMaHV]", Session["Mahv"].ToString());
                DtlAvatar.DataBind();
            }
            else
            {
                Response.Redirect("~/Default.aspx");
            }

        }

        protected void lbtthoat_Click(object sender, EventArgs e)
        {
            Session["TenDN"] = null;
            Session["rolehvgv"] = null;
            Session["Mahv"] = null;
            Response.Cookies["UserinfoDN"].Expires = DateTime.Now.AddDays(-1);
            Response.Redirect("~/Default.aspx");
        }
    }
}